$(document).ready(function() {
	$("#loadingScreen").dialog({
		autoOpen: false,
		dialogClass: "loadingScreenWindow",
		closeOnEscape: false,
		draggable: false,
		width: 350,
		minHeight: 130, 
		modal: true,
		buttons: {},
		resizable: false,
		open: function() {
			$('body').css('overflow','hidden');
		},
		close: function() {
			$('body').css('overflow','auto');
		}
	});
});

function waitingDialog(waiting) {
	if($("#loadingScreen").is(":visible")) return;
	$("div#loadingScreen").attr("class","loadingtext");
	$("#loadingScreen").html(waiting!=null && waiting.message && '' != waiting.message ? "<div class='loadingmsg'>" + waiting.message + "</div>" : "<div class='loadingmsg'>Please wait...</div>");
	$("#loadingScreen").dialog('option', 'title', waiting!=null && waiting.title && '' != waiting.title ? waiting.title : 'Loading...');
	$("#loadingScreen").dialog('open');
}
function closeWaitingDialog() {
	$("#loadingScreen").dialog('close');
}